package com.zretc.support.service;

import com.zretc.support.entity.Exampaper;
import com.zretc.support.entity.Topicmult;
import com.zretc.support.entity.Topicsingle;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.List;
import java.util.Map;

public interface ExamPaperService {

    /**
     * 1. 选择题目以生成试卷
     * @param exampaper
     * @return
     */
    Exampaper generatePaper(Exampaper exampaper);

    /**
     * 2. 随机生成试卷
     * @param courseId
     * @param num1
     * @param num2
     * @param num3
     * @param num4
     * @param num5
     * @return
     */
    Exampaper randomGeneratePaper(long courseId,int num1,int num2,int num3,int num4,int num5);

    /**
     * 3. excel导入生成试卷
     * @param courseId
     * @param file
     * @return
     */
    int excelGenerate(Long courseId, MultipartFile file);

    /**
     * 分页查询试卷  -- 根据课程编号
     * @param courseId
     * @param page
     * @param size
     * @return
     */
    Page<Exampaper> getExampaperByPage(List<Long> courseId, int page, int size);

    /**
     * 5. 统计该试卷总分
     * @param paperId
     * @return
     */
    int countExampaperBypaperId(Integer paperId);

    /**
     * 6. 根据试卷编号获取试卷信息
     * @param paperId
     * @return
     */
    Exampaper getExampaperByPaperId(Integer paperId);

    /**
     * 7. 根据 paperId 获得试题信息
     * @param paperId
     * @return
     */
    Map<Integer,Object> getTopicsByPaperId(Integer paperId);

    /**
     * 8. 根据 paperId 获得single试题信息
     * @param paperId
     * @return
     */
    Map<Integer, List<Topicmult>> getTopicsByPaperId2(Integer paperId);

    /**
     * 9. 根据 paperId 获得mult试题信息
     * @param paperId
     * @return
     */
    Map<Integer, List<Topicsingle>> getTopicsByPaperId1(Integer paperId);

    /**
     * 10. 获得某同学 某份试卷的试题信息和答题信息
     * @param paperId
     * @param userId
     * @param examId
     * @return
     */
    Map<Integer, Object> getTopicsAndAnswers(Integer paperId,String userId,int examId);
}
